package com.ruoyi.sl.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sl.mapper.SlFullAttendanceMapper;
import com.ruoyi.sl.domain.SlFullAttendance;
import com.ruoyi.sl.service.ISlFullAttendanceService;

/**
 * 考勤日期Service业务层处理
 * 
 * @author admin
 * @date 2024-06-11
 */
@Service
public class SlFullAttendanceServiceImpl implements ISlFullAttendanceService 
{
    @Autowired
    private SlFullAttendanceMapper slFullAttendanceMapper;

    /**
     * 查询考勤日期
     * 
     * @param faId 考勤日期主键
     * @return 考勤日期
     */
    @Override
    public SlFullAttendance selectSlFullAttendanceByFaId(Long faId)
    {
        return slFullAttendanceMapper.selectSlFullAttendanceByFaId(faId);
    }

    /**
     * 查询指定日期对应月份的考勤
     *
     * @param workDate 报工日期
     * @return 考勤日期
     */
    @Override
    public SlFullAttendance selectSlFullAttendanceByDate(Date workDate) {
        return slFullAttendanceMapper.selectSlFullAttendanceByDate(workDate);
    }

    /**
     * 查询指定日期对应月份的考勤
     *
     * @param map 年 月
     * @return 考勤日期
     */
    @Override
    public SlFullAttendance selectSlFullAttendanceByMonth(Map map){
        return slFullAttendanceMapper.selectSlFullAttendanceByMonth(map);
    }

    /**
     * 查询考勤日期列表
     * 
     * @param slFullAttendance 考勤日期
     * @return 考勤日期
     */
    @Override
    public List<SlFullAttendance> selectSlFullAttendanceList(SlFullAttendance slFullAttendance)
    {
        return slFullAttendanceMapper.selectSlFullAttendanceList(slFullAttendance);
    }

    /**
     * 新增考勤日期
     * 
     * @param slFullAttendance 考勤日期
     * @return 结果
     */
    @Override
    public int insertSlFullAttendance(SlFullAttendance slFullAttendance)
    {
        slFullAttendance.setCreateTime(DateUtils.getNowDate());
        return slFullAttendanceMapper.insertSlFullAttendance(slFullAttendance);
    }

    /**
     * 修改考勤日期
     * 
     * @param slFullAttendance 考勤日期
     * @return 结果
     */
    @Override
    public int updateSlFullAttendance(SlFullAttendance slFullAttendance)
    {
        slFullAttendance.setUpdateTime(DateUtils.getNowDate());
        return slFullAttendanceMapper.updateSlFullAttendance(slFullAttendance);
    }

    /**
     * 批量删除考勤日期
     * 
     * @param faIds 需要删除的考勤日期主键
     * @return 结果
     */
    @Override
    public int deleteSlFullAttendanceByFaIds(Long[] faIds)
    {
        return slFullAttendanceMapper.deleteSlFullAttendanceByFaIds(faIds);
    }

    /**
     * 删除考勤日期信息
     * 
     * @param faId 考勤日期主键
     * @return 结果
     */
    @Override
    public int deleteSlFullAttendanceByFaId(Long faId)
    {
        return slFullAttendanceMapper.deleteSlFullAttendanceByFaId(faId);
    }
}
